public class LICZBA {
 
        public static void main(String[] args) {
        
                
                int liczba, system = 0;
              
        try{    
                
                liczba = Integer.parseInt(args[0]);
                system = Integer.parseInt(args[1]);
        
        }catch(NumberFormatException ex)
        {System.out.println("B³¹d");}
        
        }
        
        public static String zamiana(int liczba, int system) throws NumberFormatException{
                String wynik = "";
                
                if((system < 2) || (system > 16) )
                  throw new NumberFormatException();
                char[] tablica = 
                {'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
                
                for(int i = liczba; i > 0;i = (i/system)){      
                        wynik = tablica[i%system] + wynik;}
          
                return wynik; 
        }         
        
    }       
        
